﻿ 

//-------------页面初始化--------------
function initPage()
{
    on_query();  
} 

//-------------查询-----------
function on_query()
{ 	
	CleanConfig(); //清空配置 
	  
	AddItemConfig("id", 0);	   
	AddItemConfig("timeline", 0); 
	AddItemConfig("msg", 0);   
	AddItemConfig("id", 2, "selectItem", "查看"); 
	
	SetPagingConfig("paging_sys_log", "get_log_error_total", "", 
					"paging_sys_log", "get_log_error_list", "");
					
	PagingInit(10, "tbody_query", "div_paging");            
}
 
//查看
function selectItem(index, id)
{ 	
	var data = "&id=" + id;
	PostToPHP(__selectItemCallback, "sys_log", "select_log_error", data);
}
function __selectItemCallback(text)
{
	//alert(text); 
	var jsonObj = String2JSON(text);
	var ds = GetDataSet(jsonObj);
 	if(jsonObj && ds[0])
    {   
        var items = ds[0];  
        
		for(var name in items)
		{ 
			tmpObj = $(name);   
			if(tmpObj)
			{	
				//alert(tmpObj);
				tmpObj.value = items[name];
			}
		}
	}
} 
